TWiki . EBR . CoreSoftwareNode

Table Of Contents

Introduction

This section covers the installation, configuration and registration of a Core Software Node.

Node Installation Guide

This section details the steps necessary to install and activate a CoreSoftware EbrNode.

Install Java

The CoreSoftware is written in Java and requires a Sun Java Runtime Edition >= than v1.4.0 to be installed on the target machine.

This software and platform specific installation notes can be downloaded from Sun Java Site (http://java.sun.com/) or found within the Java Runtimes folder on the AdminSite.

Ensure that Java is correctly installed on the target system. It is recommended that the directory containing the java executable is added to the appropriate "path" environment variable.

Install Core Software

Decide on where you are going to store the EBR Software on your system. In the following examples we are storing the software in a directory named /usr/local/ebr. You can alter this to suit your own system policy. Download EBRSoftware.zip from the SNAS and place it in your chosen directory. Unzip the contents into that directory. You should see a layout such as:

rio:/usr/local/ebr# ls -l
total 544
drwxrwxr-x    3 root     staff        4096 Nov  1 14:07 classes
-rw-r--r--    1 root     staff      539744 Nov  1 14:07 EBRSoftware.zip
drwxrwxr-x    3 root     staff        4096 Nov  1 14:01 g2
drwxrwxr-x    2 root     staff        4096 Sep  3 14:12 lib

Create User

Decide which user on the system is going to run the EbrNode. It is recommended that a special new ebrnode user is created.

Login as the new user and set the new users system CLASSPATH to reflect where the EBR software was installed.

For example, for the installation above, the following CLASSPATH should be set (UPDATED for the GammaPhase CoreSoftware release)

$ export CLASSPATH=/usr/local/ebr/classes:/usr/local/ebr/lib/mail.jar:/usr/local/ebr/lib/activation.jar:/usr/local/ebr/lib/jdom.jar:
/usr/local/ebr/lib/jox116.jar:/usr/local/ebr/lib/orctel-io-v0_0_1.jar:/usr/local/ebr/lib/ebr-message-v0_1_4.jar:.

This should be added to the profile (or system equivalent) of the user to save setting it each time.

TIP - NOTE: Ensure that the current working directory (".") is in the CLASSPATH. Without this any locally developed EbrServices will fail to be found at runtime.

Node Configuration

Copy the example configuration file to the EbrNode user home directory. For example:

cp -rf /usr/local/ebr/g2/example_configs/node/config $HOME

The contents of this directory should now be:

ebrnode@rio:~$ ls -l
total 4
drwxr-xr-x    2 ebrnode  ebrnode      4096 Nov  1 14:20 config
ebrnode@rio:~$ ls -l config/
total 12
-rw-r--r--    1 ebrnode  ebrnode      4118 Nov  1 14:20 config.xml
-rw-r--r--    1 ebrnode  ebrnode       841 Nov  1 14:19 EBRClientList.xml

Within the config directory is the main EbrNode configuration file, config.xml

The values in this file need to be amended to reflect your EbrNode, e.g. its ID, port number, native services supported, etc.

See the default configuration file for detailed, commented information regarding all modifiable fields.

Starting The Node

Change your working directory to the EbrNode directory.

$ cd $HOME

Now launch the EbrNode with the following command:

$ java com.orctel.ebr.core.Node

You should now see a message stating that the EbrNode has started.

Stopping The Node

In most cases a Ctrl+c keyboard signal will terminate the Java process.

Advanced "background" starting and stopping procedures such as using nohup are platform specific and left to the EbrNode system administrator to implement.

Node Registration

Once you have installed your EbrNode you must register it at the AdminSite (even if you do not support any EbrServices initially). The information you register must match the details you have supplied in your EbrNode configuration file.

NTP Configuration

To ensure date / time accuracy in the EbrNode logs (which are synchronized at the ServiceNode) it is vital that EbrNode administrators make use of the NTP server held at ebr.orctel.com.

This is platform dependent, but all EbrNodes running CoreSoftware must ensure that they have a NTP client regularly updating from (or weighted towards) ebr.orctel.com to keep their clocks aligned with the rest of the EbrNetwork.

For more information on NTP and software for your platform please see http://www.ntp.org/

Adding A Service

This section describes how to a add a new EbrService to your CoreSoftware EbrNode by guiding you through the addition and testing of an example EbrService. This procedure is typically used in cases where the LocalServices option is chosen, i.e. no EbrGateway is in operation, and you have chosen to "plug-in" your Java EbrServices directly into the NationalGatewayNode.

Obtain UpCaseService.java

This can be found in the example_services folder of the CoreSoftware distribution. It is a simple, example EbrService that returns the message the EbrClient sent, but converted to upper case.

Copy UpCaseService.java to the home directory of your EbrNode user (see CreateUser).

cp /usr/local/ebr/g2/example_services/UpCaseService.java $HOME

The directory should now look like:

ebrnode@rio:~$ ls -l
total 148
drwxr-xr-x    2 ebrnode  ebrnode      4096 Nov  1 14:20 config
drwxr-xr-x   21 ebrnode  ebrnode      4096 Nov  1 14:38 data
-rw-r--r--    1 ebrnode  ebrnode    125703 Nov  1 14:38 datalayer.zip
drwxr-xr-x    2 ebrnode  ebrnode      4096 Nov  1 14:38 logs
-rw-r--r--    1 ebrnode  ebrnode      3553 Nov  1 14:37 UpCaseService.java

We are now ready to compile the Java source into byte code.

Service Compilation

Next, compile UpCaseService.java.

$ javac -d . UpCaseService.java

If all goes well, you should have created UpCaseService.class in the $HOME/my/services directory. Verify this by listing the directory contents. It should resemble:

ebrnode@rio:~$ ls -l $HOME
total 148
drwxr-xr-x    2 ebrnode  ebrnode      4096 Nov  1 14:20 config
drwxr-xr-x   21 ebrnode  ebrnode      4096 Nov  1 14:38 data
-rw-r--r--    1 ebrnode  ebrnode    125703 Nov  1 14:38 datalayer.zip
drwxr-xr-x    2 ebrnode  ebrnode      4096 Nov  1 14:38 logs
drwxr-xr-x    3 ebrnode  ebrnode      4096 Nov  1 14:37 my
-rw-r--r--    1 ebrnode  ebrnode      3553 Nov  1 14:37 UpCaseService.java
ebrnode@rio:~$ ls -l /home/ebrnode/my/services/
total 4
-rw-r--r--    1 ebrnode  ebrnode      3203 Nov  1 14:37 UpCaseService.class

Update config.xml

We are almost ready to test the new EbrService, but first you must add the new EbrService to the EbrNode configuration file, config.xml. Add the following line to the <ServiceList> element.

<Service name="UpCaseService" handler="my.services.UpCaseService"/> 

Your <ServiceList> should now resemble something like:

<ServiceList>
<Service name="EBR_NetworkPoll_1" handler="com.orctel.ebr.service.NetworkPollService"/>
<Service name="EBR_CompanyProfile_1" handler="com.orctel.ebr.gateway.CompanyProfile"/>
<Service name="EBR_StoreMessage_1" handler="com.orctel.ebr.service.StoreMessageService"/>
<Service name="UpCaseService" handler="my.services.UpCaseService"/>
</ServiceList>

Restart Node

You can now restart your Node if necessary (see EbrNodeStopping, EbrNodeStarting).

Test With SendMsg tool

We can now test the new service using the SendMsg tool.

Start a new console session (separate from your EbrNode session - which should still be running) with a user that has the same Java CLASSPATH configuration as the EbrNode user.

Copy the file upcaserequest.mime from your EBR installation directory to a location of your choice. For example:

$ cp /usr/local/ebr/g2/example_messages/upcaserequest.mime /tmp/

Edit the copied file upcaserequest.mime and change the EbrMessagePartHeader X-Ebr-Destination: GBR_LD_devldc to be X-Ebr-Destination: YOUR_NODE_ID, i.e. the value should match the ThisNode->ID in your EbrNode config.xml.

Now, run the following command, substituting HOSTNAME and PORT to be the real values that your EbrNode is using.

$ java com.orctel.ebr.core.SendMsg HOSTNAME PORT /tmp/upcaserequest.mime

You should see the following message correctly returned

Message-ID: <11860693.1035975336073.JavaMail.mwood@eh1>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="----=_Part_6_7841785.1035975336071"
X-Ebr-Message-ID: MY_UNIQUE_ID
X-Ebr-Part-Count: 1
X-Ebr-Total-Cost-Euro: 200
X-Ebr-Version: 2.00
X-Ebr-Time-Stamp: 01/02/2002:16:38:15 +0000
X-Ebr-Target: ebr

------=_Part_6_7841785.1035975336071
Content-Type: text/xml; name=test.xml
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=test.xml
X-Ebr-Source: test
X-Ebr-Destination: GBR_LD_devldc
X-Ebr-User-ID: orc/1234
X-Ebr-Local-ID: orc/111ABC
X-Ebr-Service: UpCaseService
X-Ebr-Service-Status: 0
X-Ebr-Core-Status: 0
X-Ebr-Part-ID: MY_UNIQUE_ID/0
X-Ebr-Part-Number: 0
X-Ebr-Part-Cost-Euro: 20
X-Ebr-Session-ID: 20
X-Ebr-Log-Key: 0
X-Ebr-Delivery-Method: inline
X-Ebr-Delivery-Info:

<?xml version="1.0" encoding="UTF-8"?>
<UpCaseReply>
<message>I WISH I WAS A LITTLE BIT TALLER</message>
</UpCaseReply>


------=_Part_6_7841785.1035975336071--

(Always refer to the EbrMessageHeaderTable for the latest set of EbrMessageHeaders. Examples may reference older EbrProtocol versions)

The message string is now converted to upper case.

Security

Your system firewall (or equivalent protection system) will need to allow incoming requests from ebr.orctel.com and ebrtest.orctel.com plus all other EbrNodes on the port number you have set your Node to operate on. You will also need to allow outgoing requests to ebr.orctel.com, ebrtest.orctel.com and any other EbrNode you wish to contact (this especially applies to NationalDistributorNodes) on any port.

Comments / Feedback


Your post will appear before this form in chronological order (newest at bottom)

----- Revision r1.4 - 24 Oct 2003 - 13:21 GMT - MartinWood
Copyright © 1999-2003 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback.